-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable S3TC_BPTC but not ETC2_ASTC by default #77105
Enable S3TC_BPTC but not ETC2_ASTC by default #77105
Conversation
The issue will still come back if one of these are disabled. I'd prefer not to import both formats by default as importing ETC/ASTC is way slower so you end up more than doubling the import time of textures. Would it make sense to provide a |
@clayjohn Changing the default setting based on the platform does not work and is precisely why this bug exists. The imported texture formats are explicitly saved in the Every time we open our project on macOS, we get our
Every time we open our project on Windows or Linux, we get our
If we wanted the format to change depending on the OS, it must not be saved in the |
We need to rethink this. As far as I know this doubles the exported image size and time complexity. |
@fire It doesn't affect exported images, that's controlled by the export presets. This only affects the imported images. |
8059151
to
3a604bb
Compare
As we discussed on RC with @reduz, enabling both is too wasteful, but the default for macOS should be changed to |
86a15b2
to
c1b7601
Compare
@akien-mga Changed as requested. |
@@ -2870,8 +2870,8 @@ TypedArray<StringName> RenderingServer::_global_shader_parameter_get_list() cons | |||
} | |||
|
|||
void RenderingServer::init() { | |||
GLOBAL_DEF_RST_NOVAL_BASIC("rendering/textures/vram_compression/import_s3tc_bptc", OS::get_singleton()->get_preferred_texture_format() == OS::PREFERRED_TEXTURE_FORMAT_S3TC_BPTC); | |||
GLOBAL_DEF_RST_NOVAL_BASIC("rendering/textures/vram_compression/import_etc2_astc", OS::get_singleton()->get_preferred_texture_format() == OS::PREFERRED_TEXTURE_FORMAT_ETC2_ASTC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we change the preferred OS texture format on macOS instead? This will likely make it still look up ETC2/ASTC and thus not work on Intel Mac.
Also this might break the Android editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should also do that. But not instead. To be clear, the project settings themselves must not change between platforms. The behavior can change, sure, but not the booleans themselves, or else you get diffs in project.godot
when you switch between platforms.
Users of the Android editor will need this setting enabled to avoid .import file diffs compared to desktop platforms, however even with this setting disabled Android will still import what it needs, you'll just get diffs in the .import files. However the difference is that with this setting enabled you can enforce it being imported on all platforms, while in the current master Godot just automatically deletes the setting from project.godot, making it useless.
c1b7601
to
944fbce
Compare
Thanks! |
Just a note that this PR is incorrect and it will break the Android and web editors, as well as Linux on ARM. OS::PreferredTextureFormat OS_MacOS::get_preferred_texture_format() const {
// macOS supports both formats on ARM. Prefer S3TC/BPTC
// for better compatibility with x86 platforms.
return PREFERRED_TEXTURE_FORMAT_S3TC_BPTC;
} and nothing else. Everything else this PR adds is unnecessary. I suggest reverting. |
@reduz I will explain again. The default values of the project settings booleans themselves MUST NOT change between platforms. If they do, the setting is erased by Godot whenever you switch platforms. The setting in |
Fixes #74609 (tested and working), regression from #72031 (probably)
The formats are now both enabled by default, which allows exporting for platforms that use either one. Note that which formats get included in the export depend on the export settings.The S3TC_BPTC is now enabled by default, and ETC2_ASTC is disabled by default.More importantly, this fixes an issue where x86 platforms (ex: Windows x86_64) and Arm platforms (ex: macOS arm64) would fight over the texture format. Setting either one enabled in project settings would be useless because the other platform would have a different default setting so it would be wiped from
project.godot
. Now the project settings do not depend on the OS so it will work across platforms and you won't get diffs and reimports.